//
//  SMPermission.m
//  ShopingMall
//
//  Created by xinqiao on 2016/12/30.
//  Copyright © 2016年 Jon_G. All rights reserved.
//

#import "SMPermission.h"

@implementation SMPermission
/**
 *  role:初始化
 **/
- (NSUserDefaults *)userDefault {
    if (_userDefault == nil) {
        _userDefault = [NSUserDefaults standardUserDefaults];
    }
    return _userDefault;
}
/**
 *  role:类方法
 **/
+ (NSUserDefaults *)getUserDefault {
    return [NSUserDefaults standardUserDefaults];
}
/**
 *  role:记录user_id
 **/
#define User_id @"user_id"
+ (void)setUser_id:(id)userId{
    [[self getUserDefault] setObject:userId forKey:User_id];
}
+ (id)getUser_id {
    return [[self getUserDefault] objectForKey:User_id];
}
/**
 *  role:记录uniquestr
 **/
#define Uniquestr @"uniquestr"
+ (void)setUniquestr:(id)uniquestr{
    [[self getUserDefault] setObject:uniquestr forKey:Uniquestr];
}
+ (id)getUniquestr {
    return [[self getUserDefault] objectForKey:Uniquestr];
}
/**
 *  role:记录userinfostr
 **/
#define Userinfostr @"userinfostr"
+ (void)setUserinfostr:(id)userinfostr{
    [[self getUserDefault] setObject:userinfostr forKey:Userinfostr];
}
+ (id)getUserinfostr {
    return [[self getUserDefault] objectForKey:Userinfostr];
}
/**
 *  role:记录user_phone
 **/
#define User_phone @"user_phone"
+ (void)setUser_phone:(id)user_phone{
    [[self getUserDefault] setObject:user_phone forKey:User_phone];
}
+ (id)getUser_phone {
    return [[self getUserDefault] objectForKey:User_phone];
}
/**
 *  role:记录user_phone
 **/
#define PHPSESSID @"PHPSESSID"
+ (void)setPHPSESSID:(id)PhpSessid{
    [[self getUserDefault] setObject:PhpSessid forKey:PHPSESSID];
}
+ (id)getPHPSESSID {
    return [[self getUserDefault] objectForKey:PHPSESSID];
}
/**
 *  role:记录登录状态login
 **/
#define Login @"login"
+ (void)setLoginBool:(BOOL)isBool{
    [[self getUserDefault] setBool:isBool forKey:Login];
}
+ (BOOL)getLoginBool{
    return [[self getUserDefault] boolForKey:Login];
}
/**
 *  role:记录LoginName
 **/
#define LoginName @"loginname"
+ (void)setLoginName:(id)user_name {
    [[self getUserDefault] setObject:user_name forKey:LoginName];
}
+ (id)getLoginName {
    return [[self getUserDefault] objectForKey:LoginName];
}
/**
 *  role:记录User_Pass
 **/
#define User_Pass @"user_pass"
+ (void)setUser_Pass:(id)user_pass {
    [[self getUserDefault] setObject:user_pass forKey:User_Pass];
}
+ (id)getUser_Pass {
    return [[self getUserDefault] objectForKey:User_Pass];
}
@end
